package edu.ptit.jad.model;

public class AdContent extends Ad {

	private String content;

	public AdContent(String row) {
		convertToAdContent(row);
	}

	private void convertToAdContent(String row) {
		try {

			// System.err.println(row);
			String[] splits = row.split(": : : :");

			setId(Integer.parseInt(splits[0].trim()));
			setTitle(splits[1].trim());

			setDescription(splits[2].trim());
			//setContent(splits[3].trim());

		} catch (Exception exception) {

			// exception.printStackTrace();
			System.err.println("Convert to object error! at " + row);

			// throw new AdException("Convert to object error! at " + row);

		}

	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
}
